import WMap from '../../map';
const map = new WMap.Map('map', {
	center: [104.42239474922181, 34.63836406549072]
})

map.on('click', e => {
	map.panTo(e.lngLat)
	console.log(e.lngLat)
})

const changeMapSatelliteDom = document.getElementById('changeMapSatellite')
const changeMapStandardDom = document.getElementById('changeMapStandard')
const changetianditu = document.getElementById('changetianditu')
const changeamap = document.getElementById('changeamap')
const curMapName = document.getElementById('curMapName')
curMapName.innerText = map.getBaseMap()[0].get('mapName')
//卫星地图
changeMapSatelliteDom.onclick = () => {
	map.setBaseLayer('satellite')
}

//标准地图
changeMapStandardDom.onclick = () => {
	map.setBaseLayer('standard')
}

// 天地图底图 token请自行到官网申请
changetianditu.onclick = () => {
	map.setBaseMap('tianditu')
	curMapName.innerText = map.getBaseMap()[0].get('mapName')
}

// 高德底图
changeamap.onclick = () => {
	map.setBaseMap('amap')
	curMapName.innerText = map.getBaseMap()[0].get('mapName')
}
